<include file="Public:head" />
<include file="Public:header" />
<include file="Public:left" />

<section id='content'>
<div class='container-fluid'>
<div class='row-fluid' id='content-wrapper'>
<div class='span12'>
<div class='row-fluid'>
    <div class='span12'>
        <div class='page-header'>
            <h1 class='pull-left'>
                <i class='icon-table'></i>
                <span>发现列表</span>
            </h1>
            
        </div>
    </div>
</div>


<div class='row-fluid'>
    <div class='span12 box bordered-box blue-border' style='margin-bottom:0;'>
        <div class='box-header blue-background'>
            <div class='title'>发现列表</div>
            
        </div>
        <div class='box-content box-no-padding'>
            <div class='responsive-table'>
                <div class='scrollable-area'>
                    <table class='table' style='margin-bottom:0;'>
                        <thead>
                        <tr>
                            <th>标题</th>
                            <th>作者公司</th>
                            <th>浏览数</th>
                            <th>分享数</th>
                            <th>建立时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <volist name="list.data" id="h">
                                <tr>
                                    <td>{$h.title}</td>                                 
                                    <td>{$h.cid|format_companyname}</td>
                                    <td>{$h.check}</td>
                                    <td>{$h.share}</td>
                                    <td>{$h.ctime|date="Y-m-d H:i",###}</td>
                                    <td>
                                        <eq name="h.is_del" value="1">
                                            <font color="red">已删除</font>
                                            <else/>
                                        <switch name="h.status">
                                            <case value="1" break="1">正常显示</case>
                                            <case value="0" break="1"><font color="blue">等待审核</font></case>
                                        </switch>
                                    </eq>
                                    </td>
                                    <td>
                                        <div class='text-left'>
                                            <a class='btn btn-warning btn-mini' data-toggle='modal' href='#modal-num{$h.fid}' role='button' >
                                                <i class='icon-edit' ></i>
                                            </a>
                                            <eq name="h.status" value="1">
                                            <a class='btn btn-info btn-mini has-tooltip' data-placement="top" title="点击转为待审核状态" href='' onclick="status({$h.fid},'0')">
                                            <else/>
                                            <a class='btn btn-info btn-mini has-tooltip' data-placement="top" title="点击审核通过" href='' onclick="status({$h.fid},'1')">
                                            </eq> 
                                                <i class='icon-retweet'></i>
                                            </a>
                                            <a class='btn btn-success btn-mini' data-toggle='modal' href='#modal-info{$h.fid}' role='button' >
                                                <i class='icon-eye-open' ></i>
                                            </a>
                                            <a class='btn btn-danger btn-mini'  onclick="del_faxian({$h.fid});">
                                                <i class='icon-remove' ></i>
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                <div class='modal hide fade' id='modal-num{$h.fid}' role='dialog' tabindex='-1'>
                                    <div class='modal-body'>
                                        <form action="__URL__/edit_faxian_num" method="post">
                                        <p>查看数量：<input name="check" type="text" value="{$h.check}">
                                        </p>
                                        <p>分享数量：<input name="share" type="text" value="{$h.share}">
                                        </p>
                                        <p><input type="hidden" name="fid" value="{$h.fid}"><input name="submit" type="submit" value="提交">
                                        </p>
                                        </form>
                                    </div>
                                    <div class='modal-footer'>
                                        <button class='btn' data-dismiss='modal'>关闭</button>
                                    </div>
                                </div>
                                <div class='modal hide fade' id='modal-info{$h.fid}' role='dialog' tabindex='-1'>
                                    <div class='modal-body'>
                                        <p>封面图片：<image src="{$h.pic.url}" style="width:120px;height:80px;">
                                        </p>
                                        <p>内容：{$h.text} 
                                        </p>
                                        
                                    </div>
                                    <div class='modal-footer'>
                                        <button class='btn' data-dismiss='modal'>关闭</button>
                                    </div>
                                </div>
                            </volist>
                            <script type="text/javascript">
                                function del_faxian(val){
                                    $.post("__URL__/del_faxian", { "id": val},
                                       function(data){
                                        if (data.status==1) {
                                          location.replace(location.href);  }
                                       }, "json");
                                            
                                } 
                                function status(id,val){
                                    $.post("__URL__/edit_faxian_status", { "id": id,"val":val},
                                       function(data){
                                        if (data.status==1) {
                                          location.replace(location.href);  }
                                       }, "json");
                                            
                                }         
                                </script>
                        </tbody>
                    </table>
                    <div>
                            {$list.html}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</div>
</div>
</div>
</section>
</div>

<include file="Public:bottom" />
<script type="text/javascript">
    $(document).ready(function () {
      $("ul[class='nav nav-stacked']").removeClass('in');
      $("#faxian").addClass('in');
      $("li[class='guan']").removeClass('active');
      $("#faxian_list").addClass('active');
    });
</script>